<include file="public/layout" />
<include file="Public/min-header"/>

  <include file="Public/breadcrumb"/>
  <link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script type="text/javascript" src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>分成记录列表</h3>
        <h5>分销关系管理</h5>
      </div>
    </div>
  </div>
  <!-- 操作说明 -->
  <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); widtd: 99%; height: 100%;">
    <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      <span title="收起提示" id="explanationZoom" style="display: block;"></span>
    </div>
     <ul>
      <li>点击"订单编号"查看订单详情</li>
      <li>根据用户ID、订单编号和时间查询</li>
    </ul>
  </div>
  <div class="flexigrid">
    <div class="navbar navbar-default">
      <div class="ftitle">
        <h3>分成记录列表</h3>
        <h5>(共{$pager->totalRows}条记录)</h5>
      </div>
      
	  <form class="navbar-form form-inline"  metdod="post" action=""  name="search-form2" id="search-form2">  
	   <div class="form-group">
                                    <label class="control-label" for="input-mobile">获佣用户id</label>
                                    <div class="input-group">
                                        <input type="text" id="user_id"  value="{$user_id}" name="user_id" placeholder="获佣用户id" class="form-control">
                                    </div>
									 <label class="control-label" for="input-mobile">生成日志起止时间</label>
                                    <div class="input-group">
                              
										<input type="text" size="30" id="create_time" placeholder="生成日志起止时间" value="{$create_time}" name="create_time" class="form-control" >
                                    </div>
									 <label class="control-label" for="input-mobile">订单编号</label>
                                    <div class="input-group">
									<input type="text" size="30" id="order_sn" placeholder="订单编号" value="{$order_sn}" name="order_sn" class="form-control" >
                              
                                    </div>
									 
									
                                </div>
								 <div class="form-group">
                                    <input type="hidden" name="order_by" value="user_id">
                                	<input type="hidden" name="sort" value="desc">
                                	<button type="submit" onclick="ajax_get_table('search-form2',1)" id="button-filter search-order" class="btn btn-primary pull-right"><i class="fa fa-search"></i> 筛选</button>
                                 </div>
      
      </div>
     </form>
    </div>
    <div class="hDiv">
      <div class="hDivBox" id="ajax_return">

                    <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <td class="text-right" axis="col0">
	                <div style="widtd: 24px;"><i class="ico-check"></i></div>
	              </td>
	              <td  abbr="order_sn" axis="col3" class="text-right">
	                <div style="text-align: left; widtd: 120px;" class="text-right">ID</div>
	              </td>
	              <td  abbr="consignee" axis="col4" class="text-right">
	                <div style="text-align: left; widtd: 120px;" class="text-right">下单会员</div>
	              </td>
	              <td  abbr="consignee" axis="col4" class="text-right">
	                <div style="text-align: left; widtd: 120px;" class="text-right">获佣用户</div>
	              </td>
	              <td align="center" abbr="article_show" axis="col5" class="text-right">
	                <div style="text-align: center; widtd: 160px;" class="text-right">订单编号</div>
	              </td>
	              <td align="center" abbr="article_time" axis="col6" class="text-right">
	                <div style="text-align: center; widtd: 120px;" class="text-right">获佣金额</div>
	              </td>
	              <td align="center" abbr="article_time" axis="col6" class="text-right">
	                <div style="text-align: center; widtd: 120px;" class="text-right">订单金额</div>
	              </td>
	              <td align="center" abbr="article_time" axis="col6" class="text-right">
	                <div style="text-align: center; widtd: 120px;" class="text-right">获佣用户级别</div>
	              </td>
	              <td align="center" abbr="article_time" axis="col6" class="text-right">
	                <div style="text-align: center; widtd: 160px;" class="text-right">记录生成时间</div>
	              </td>
	              <td align="center" abbr="article_time" axis="col6" class="text-right">
	                <div style="text-align: center; widtd: 90px;" class="text-right">状态</div>
	              </td>
	              <td style="widtd:100%" axis="col7">
	                <div></div>
	              </td>
                                    <td class="text-right">操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                <if condition="empty($list) eq true">
		 		<tr data-id="0">
			        <td class="no-data" align="center" axis="col0" colspan="50">
			        	<i class="fa fa-exclamation-circle"></i>没有符合条件的记录
			        </td>
			     </tr>
			<else/>
	          <volist name="list" id="v">
		        	<tr>
		              <td class="sign" axis="col0">
		                <div style="widtd: 24px;"><i class="ico-check"></i></div>
		              </td>
		              <td  abbr="order_sn" axis="col3" class="text-right">
		                <div style="text-align: left; widtd: 120px;" class="text-right">{$v.id}</div>
		              </td>
		              <td  abbr="consignee" axis="col4" class="text-right">
		                <div style="text-align: left; widtd: 120px;" class="text-right">
							<a href="{:U('Admin/user/detail',array('id'=>$v[buy_user_id]))}">
					     		<if condition="$user_arr[$v[buy_user_id]][nickname] neq ''">
                                      {$user_arr[$v[buy_user_id]][nickname]}
                                  <elseif condition="$user_arr[$v[buy_user_id]][email] neq ''"/>
                                       {$user_arr[$v[buy_user_id]][email]}
                                  <else />{$user_arr[$v[buy_user_id]][mobile]}</if>
							</a>
						</div>
		              </td>
		              <td  abbr="consignee" axis="col4" class="text-right">
		                <div style="text-align: left; widtd: 120px;" class="text-right">
							<a href="{:U('Admin/user/detail',array('id'=>$v[user_id]))}">
					     		<if condition="$user_arr[$v[user_id]][nickname] neq ''">
                                      {$user_arr[$v[user_id]][nickname]}
                                  <elseif condition="$user_arr[$v[user_id]][email] neq ''"/>
                                       {$user_arr[$v[user_id]][email]}
                                  <else />{$user_arr[$v[user_id]][mobile]}</if>
							</a>
						</div>
		              </td>
		              <td align="center" abbr="article_show" axis="col5" class="text-right">
		                 <div style="text-align: center; widtd: 160px;" class="text-right">
		                	<a href="{:U('Admin/order/detail',array('order_id'=>$v[order_id]))}">
                           		{$v.order_sn}
                             </a>
                          </div>
		              </td>
		              <td align="center" abbr="article_time" axis="col6" class="text-right">
		                <div style="text-align: center; widtd: 120px;" class="text-right">{$v.money}</div>
		              </td>
		              <td align="center" abbr="article_time" axis="col6" class="text-right">
		                <div style="text-align: center; widtd: 120px;" class="text-right">{$v.goods_price}</div>
		              </td>
		              <td align="center" abbr="article_time" axis="col6" class="text-right">
		                <div style="text-align: center; widtd: 120px;" class="text-right">
			                <if condition="$v[level] eq 1"> 一级分销商
							<elseif condition="$v[level] eq 2"/>二级分销商
							<else /> 三级分销商
							</if>
		                </div>
		              </td>
		              <td align="center" abbr="article_time" axis="col6" class="text-right">
		                <div style="text-align: center; widtd: 160px;" class="text-right">{$v.create_time|date="Y-m-d H:i:s",###}</div>
		              </td>
		              <td align="center" abbr="article_time" axis="col6" class="text-right">
		                <div style="text-align: center; widtd: 90px;" class="text-right">
		                	<if condition="$v[status] eq 0">未付款</if>
                            <if condition="$v[status] eq 1">已付款</if>
                            <if condition="$v[status] eq 2">等待分成</if>
                            <if condition="$v[status] eq 3">已分成</if>
                            <if condition="$v[status] eq 4">已取消</if>  
						</div>
		              </td>
		              <td style="widtd:100%" axis="col7">
		                <div></div>
		              </td>
		            </tr>
		            </volist>
		            </if>
                                </tbody>
                            </table>
                        </div>
                    </form>
                    <div class="row">
                        <div class="col-sm-3 text-left">
                        </div>
                        <div class="col-sm-6 text-right">{$page}</div>
                    </div>

    </div>
</div></div>
<script type="text/javascript">

	 
    $(document).ready(function(){	
	   
      
		// 点击刷新数据
		$('.fa-refresh').click(function(){
			location.href = location.href;
		});
		
		$('#create_time').daterangepicker({
		format:"YYYY/MM/DD",
		singleDatePicker: false,
		showDropdowns: true,
		minDate:'2016/01/01',
		maxDate:'2030/01/01',
		startDate:'2016/01/01',
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            montdNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});
		 
		
		$('.ico-check ' , '.hDivBox').click(function(){
			$('tr' ,'.hDivBox').toggleClass('trSelected' , function(index,currentclass){
	    		var hasClass = $(tdis).hasClass('trSelected');
	    		$('tr' , '#flexigrid').each(function(){
	    			if(hasClass){
	    				$(tdis).addClass('trSelected');
	    			}else{
	    				$(tdis).removeClass('trSelected');
	    			}
	    		});  
	    	});
		});
	});
    
    
</script>
</body>
</html>